The QuickTime VR Manager provides functions that you can use to manipulate the viewing angles and zooming characteristics of a QuickTime VR movie. Note that the parameters to these functions that specify angles are always interpreted in the current angular unit (degrees or radians) set by a previous call to the QTVRSetAngularUnits function. The default angular unit is degrees.
You can use the QTVRGetPanAngle function to get the pan angle of a QuickTime VR movie.
float QTVRGetPanAngle (QTVRInstance qtvr);
The QTVRGetPanAngle function returns, as its function result, a floating-point value that represents the current pan angle of the QuickTime VR movie specified by the qtvr parameter.
Use QTVRSetPanAngle (next) to set the pan angle of a movie. Listing 2-3 illustrates the use of QTVRGetPanAngle .
You can use the QTVRSetPanAngle function to set the pan angle of a QuickTime VR movie.
OSErr QTVRSetPanAngle (QTVRInstance qtvr, floatpanAngle);
The QTVRSetPanAngle function sets the pan angle of the QuickTime VR movie specified by the qtvr parameter to the value specified by the panAngle parameter. That value is constrained by the maximum and minimum pan angles of the movie. If the angle falls outside of those constraints and the control setting kQTVRWrapPan is disabled, the angle is set to the minimum or maximum, whichever is closer. If wrapping is enabled, the pan angle is clipped to fall within the constraints. Pan angle values are also clipped if the requested pan angle, when combined with the current tilt angle and field of view, would cause an image to lie outside the current constraints.
QTVRSetPanAngle returns the result code constraintReachedErr if wrapping is off and the angle is set to the minimum or maximum constraint value.
The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.
Use QTVRGetPanAngle to get the pan angle of a movie. Use QTVRGetViewingLimits to get the current viewing limits of a movie. Listing 2-3 illustrates the use of QTVRSetPanAngle . Use QTVRSetControlSetting to control the setting of kQTVRWrapPan .
You can use the QTVRGetTiltAngle function to get the tilt angle of a QuickTime VR movie.
float QTVRGetTiltAngle (QTVRInstance qtvr);
The QTVRGetTiltAngle function returns, as its function result, a floating-point value that represents the current tilt angle of the QuickTime VR movie specified by the qtvr parameter.
Use QTVRSetTiltAngle (next) to set the tilt angle of a movie. Listing 2-3 illustrates the use of QTVRGetTiltAngle .
You can use the QTVRSetTiltAngle function to set the tilt angle of a QuickTime VR movie.
OSErr QTVRSetTiltAngle (QTVRInstance qtvr, floattiltAngle);
The QTVRSetTiltAngle function sets the tilt angle of the QuickTime VR movie specified by the qtvr parameter to the value specified by the tiltAngle parameter. That value is constrained by the maximum and minimum tilt angles of the movie. If the angle falls outside of those constraints and the control setting kQTVRWrapTilt is disabled, the angle is set to the minimum or maximum, whichever is closer. If wrapping is enabled, the tilt angle is clipped to fall within the constraints. Tilt angle values are also clipped if the requested tilt angle, when combined with the current pan angle and field of view, would cause an image to lie outside the current constraints.
QTVRSetTiltAngle returns the result code constraintReachedErr if wrapping is off and the angle is set to the minimum or maximum constraint value.
The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.
Use QTVRGetTiltAngle to get the tilt angle of a movie. Use QTVRGetViewingLimits to get the current viewing limits of a movie. Listing 2-3 illustrates the use of QTVRSetTiltAngle . Use QTVRSetControlSetting to control the setting of kQTVRWrapTilt .
You can use the QTVRGetFieldOfView function to get the vertical field of view of a QuickTime VR movie.
float QTVRGetFieldOfView (QTVRInstance qtvr);
The QTVRGetFieldOfView function returns, as its function result, the current vertical field of view of the QuickTime VR movie specified by the qtvr parameter. The vertical field of view is a floating-point value that specifies the angle created by the two lines that connect the viewpoint to the top and bottom of the image.
Use QTVRSetFieldOfView (next) to set the vertical field of view of a QuickTime VR movie. Listing 2-4 illustrates the use of QTVRGetFieldOfView .
You can use the QTVRSetFieldOfView function to set the vertical field of view of a QuickTime VR movie.
OSErr QTVRSetFieldOfView (QTVRInstance qtvr, floatfieldOfView);
The QTVRSetFieldOfView function sets the vertical field of view of the QuickTime VR movie specified by the qtvr parameter to the value specified by the fieldOfView parameter. That value is constrained by the maximum field of view of the movie. Values that lie outside that limit are clipped to the maximum. Pan and tilt angle values are also clipped if, when combined with the current field of view, they would cause an image to lie outside the current constraints.
If the control setting kQTVRCanZoom is disabled, the field of view is unchanged and QTVRSetFieldOfView returns the result code constraintReachedErr .
The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.
Use QTVRGetFieldOfView to get the vertical field of view of a QuickTime VR movie. Listing 2-4 illustrates the use of QTVRSetFieldOfView . Use QTVRSetControlSetting to control the setting of kQTVRCanZoom .
You can use the QTVRGetViewCenter function to get the view center of a QuickTime VR movie.
OSErr QTVRGetViewCenter (QTVRInstance qtvr, QTVRFloatPoint *viewCenter);
You can use the QTVRSetViewCenter function to set the view center of a QuickTime VR movie.
OSErr QTVRSetViewCenter (
QTVRInstance qtvr,
const QTVRFloatPoint *viewCenter);
The QTVRSetViewCenter function sets the view center of the QuickTime VR movie specified by the qtvr parameter to the fixed point specified by the viewCenter parameter. That point is constrained by the current field of view of the movie. The values you pass in the QTVRFloatPoint structure are adjusted so that the magnified area does not show anything outside the view.
If the kQTVRTranslation control setting is disabled, the QTVRSetViewCenter function returns the result code constraintReachedErr and doesn't change the current view center.
Use QTVRGetViewCenter to get the view center of a movie. Use QTVRSetControlSetting to control the setting of kQTVRTranslation .
You can use the QTVRNudge function to turn one step in a particular direction and display the new view.
OSErr QTVRNudge (QTVRInstance qtvr, QTVRNudgeControl direction);
The QTVRNudge function adjusts the current view of the movie specified by the qtvr parameter as indicated by the direction parameter. In particular, QTVRNudge turns one step in the indicated direction and displays the new view.
For example, to move to the next view that is right and up from the current view, set the direction parameter to kQTVRUpRight (that is, /4 radians, or 45 degrees). Any value of the direction parameter that is not predefined is mapped to the closest defined value. For objects, if no view is located at the adjacent object view defined by the nudge direction and wrapping is off in the desired direction, then QTVRNudge remains at the current view and returns the result code constraintReachedErr .
For objects, QTVRNudge is useful for changing to an adjacent view without having to know the new pan and tilt angles.
The direction of the nudge is affected by the current control settings. See "Control Settings" for more information.
Use QTVRSetPanAngle and QTVRSetTiltAngle to move to a new view specified using pan and tilt angles.
You can use the QTVRInteractionNudge function either to translate the image and display the new view or to rotate the object in a particular direction and display its new appearance. The current setting of the interaction property for kQTVRInteractionNudgeMode determines whether the nudge action translates the image or rotates the object.
OSErr QTVRInteractionNudge (QTVRInstance qtvr, QTVRNudgeControl direction);
The QTVRInteractionNudge function adjusts the current view of the movie specified by the qtvr parameter as indicated by the direction parameter. The type of adjustment depends on the property setting for nudge interaction mode. If the nudge interaction mode is kQTVRNudgeRotate, the action of the QTVRInteractionNudge function is to rotate the object in the specified direction. If the nudge interaction mode is kQTVRNudgeTranslate, the action of the QTVRInteractionNudge function is to translate the image in the specified direction.
If the nudge interaction mode is kQTVRUNudgeSameAsMouse, the action of the QTVRInteractionNudge function is determined by the current mouse mode.
Use the functions QTVRGetInteractionProperty and QTVRSetInteractionProperty to set the nudge mode and direction properties.
You can use the QTVRShowDefaultView function to display the default view of a node.
OSErr QTVRShowDefaultView (QTVRInstance qtvr);
The QTVRShowDefaultView function sets the default values of the pan angle, tilt angle, field of view, view center (for object nodes), default state, mouse-down state, and all applicable animation and control settings for the node specified by the qtvr parameter. A node's default values are stored in the movie file.
| Previous | Chapter Contents | Chapter Top | Next |